public class Person {
    private int age;

    public void setAge(int age) {

        if (age >= 0 && age <= 100){

            System.out.println("输入的年龄不合法。");
    }
     else {
            this.age= age;
     }

    }

}

